package com.train.controller;

import com.train.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Desc: 用户控制层 只做转发，不写逻辑业务
 * @Author: wjl
 * @DateTime: 2025/05/12 20:05:15
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
    private final UserService service;


    /**
     * @param phone 手机号
     * @param password 密码
     * @Desc: 用户登录
     * @Author: wjl
     * @DateTime: 2025/05/12 20:17:51
     * @Return: @return {@link String }
     */
    @PostMapping("/login")
    public String login(String phone, String password) {
        return service.login(phone,password);
    }
}
